package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.can.CANTimeoutException;

public class CANArm extends SimpleRobot {
    CANJaguar jag1; 
    CANJaguar jag2;
    Joystick joy = new Joystick(1);
    public void autonomous() {
        
    }
    
    public void robotInit(){
        try {
            jag1 = new CANJaguar(1, CANJaguar.ControlMode.kVoltage);
            jag2 = new CANJaguar(2, CANJaguar.ControlMode.kVoltage);
        } catch (CANTimeoutException ex) {
            ex.printStackTrace();
        }
    }

    public void operatorControl() {
        while (isEnabled() && isOperatorControl()){
            double power = joy.getY()*12;
            try {
                jag1.setX(power);
                jag2.setX(jag1.getOutputVoltage());
                
            } catch (CANTimeoutException ex) {
                ex.printStackTrace();
            }
        }
    }

    public void test() {
    
    }
}
